package model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the cliente_endereo database table.
 * 
 */
@Embeddable
public class ClienteEndereoPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="cliente_id", insertable=false, updatable=false, unique=true, nullable=false)
	private int clienteId;

	@Column(name="endereco_id", unique=true, nullable=false, length=45)
	private String enderecoId;

	public ClienteEndereoPK() {
	}
	public int getClienteId() {
		return this.clienteId;
	}
	public void setClienteId(int clienteId) {
		this.clienteId = clienteId;
	}
	public String getEnderecoId() {
		return this.enderecoId;
	}
	public void setEnderecoId(String enderecoId) {
		this.enderecoId = enderecoId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof ClienteEndereoPK)) {
			return false;
		}
		ClienteEndereoPK castOther = (ClienteEndereoPK)other;
		return 
			(this.clienteId == castOther.clienteId)
			&& this.enderecoId.equals(castOther.enderecoId);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.clienteId;
		hash = hash * prime + this.enderecoId.hashCode();
		
		return hash;
	}
}